package com.work.simpleoa.gencode.model;

import com.work.simpleoa.emun.TemplateEmun;
import com.work.simpleoa.gencode.AbstractAutoGenChain;
import com.work.simpleoa.gencode.IAutoGenChain;
import com.work.simpleoa.util.BeetlUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * @description: ControllerModelChain
 * @author: liuwangzhen
 * @date: 2018-12-17 上午9:49
 */
@Component
public class ControllerModelChain extends AbstractAutoGenChain {

    private static final Logger log = LoggerFactory.getLogger(ControllerModelChain.class);

    @Autowired
    @Qualifier("serviceModelChain")
    IAutoGenChain serviceModelChain;

    public ControllerModelChain(){
        super(TemplateEmun.CONTROLLER_TEMPLATE);
    }



    @Override
    public Boolean isCurrentType(TemplateEmun templateEmun) {
        if (myEmun.getName().equals(templateEmun.getName())) {
           return Boolean.TRUE;
        } else {
            return Boolean.FALSE;
        }
    }


    @Override
    public Boolean nextGenChain(TemplateEmun templateEmun){
        return serviceModelChain.distinctTypeAndGen(templateEmun);
    }

    @Override
    public Logger getLogger() {
        return log;
    }
}
